Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizations using caching #453

Merged
merged 16 commits into from
Oct 28, 2024
Merged

Optimizations using caching #453

merged 16 commits into from
Oct 28, 2024

Conversation

danmatichuk
Copy link
Collaborator

No description provided.

this was disabled to avoid edge cases where the function
cache would become invalidated as a result of injecting
pate's abstract domain information into macaw

this lack of caching can adversely affect discoverPairs
in cases where many blocks need to be inspected
(since macaw starts over each time)

if we flush the cache for each node (by adding
a flushCache to addOverrides), then we can avoid
this duplicated work without worrying about invalid
cache entries
simplifies the logic required to keep the code discovery
cache valid by instead comparing any current state overrides to
what they were when the retrieved cache entry was created

this avoids the need to explicitly flush the cache whenever
any state override occurs, and consequently allows the cache
to be less conservative
rather than asking the solver to concretize each value individually,
this strategy instead collects all values to be concretized and
concretizes them all at once

in most cases this seems to be an improvement, but there are edge
cases where the batch processing times out and we need to fall back
to the original approach
… only some concrete

this relaxes the heuristic slightly to ensure that we attempt to
concretize the contents of a memory cell if it was ever written to
with a concrete value. Previously we attempted to compute a single
abstract domain for the entire cell, which is not always possible.
nothing actually depends on this, for the most part
it just wastes time
a forked instance of the solver has the same assumption context,
and so any results about satisfiability/unsatisfiability can
be re-used by other threads
in practice this turns out to be the most expensive
strategy to try in cases where it doesn't apply
the assumption state in 'envCurrentFrame' is not 100% complete,
as it is missing bounds assumptions for bounded constants
this is a workaround for cases where what4 fails to introduce
this assumption itself
@danmatichuk danmatichuk marked this pull request as ready for review October 28, 2024 22:22
@danmatichuk danmatichuk merged commit 76318a0 into master Oct 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant